class Solution {
public:
    vector<vector<int>> generate(int numRows) {
        vector<vector<int>> vv;
        for (int i = 0; i < numRows; i++)
        {
            vector<int> v(i + 1, 1);
            vv.push_back(v);
        }
        if (numRows >= 3)
        {
            for (int i = 2; i < numRows; i++)
            {
                for (int j = 1; j < i; j++)
                {
                    vv[i][j] = vv[i - 1][j - 1] + vv[i - 1][j];
                }
            }
        }
        return vv;
    }
};